<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="../../tag/c.tld"%>
<!DOCTYPE html>
<html lang="en">
<head>

<title>华集技师管理</title>
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

<link rel="stylesheet" href="../css/bootstrap.css" />
<link rel="stylesheet" href="../css/font-awesome.css" />

<link rel="stylesheet" href="../css/jquery-ui.css" />
<link rel="stylesheet" href="../css/datepicker.css" />

<link rel="stylesheet" href="../css/ace-fonts.css" />

<link rel="stylesheet" href="../css/ace.css" />
<!-- ie9 -->
<link rel="stylesheet" href="../css/ace-part2.css" />
<link rel="stylesheet" href="../css/ace-ie.css" />

<script src="../js/jquery.js"></script>
<script src='../js/ace/jquery.mobile.custom.js'></script>
<script src="../js/ace/bootstrap.js"></script>

<script src="../js/ace/ace/ace.js"></script>
<script src="../js/ace/ace/ace.sidebar.js"></script>
</head>
<body class="no-skin">
<jsp:include page="../../margin/head.jsp"></jsp:include>
<div class="main-container" id="main-container">
	<jsp:include page="../../margin/left.jsp"></jsp:include>
	<div class="main-content">
		<!-- 导航菜单 -->
		<div class="breadcrumbs" id="breadcrumbs">
			<ul class="breadcrumb">
				<li><i class="ace-icon fa fa-home home-icon"></i> <a href="${pageContext.request.contextPath}/user/list">Home</a></li>
				<li><a href="/LongShengManager/user/list">试压员</a></li>
				<li class="active">技师列表</li>
			</ul>
		</div>
		<div class="page-content">
			<div class="main-content-inner">
				<div class="row">
					<form action="${pageContext.request.contextPath}/user/list" method="post" id = "aa">
						<div class="col-lg-4 col-xs-6 col-sm-6">
							<div class="input-group">
								<span class="input-group-addon">姓名</span> <input
									class="form-control" value="${name}" name="name" />
							</div>
						</div>
				
						<div class="col-lg-1 col-xs-2 col-sm-2">
							<button class="btn btn-primary btn-sm">查询</button>
						</div>
						<div class="col-lg-1 col-xs-2 col-sm-2"></div>
					</form>
					<div class="col-lg-1 col-xs-2 col-sm-2">
							<button class="btn btn-info btn-sm" type="button" onclick="add()">添加</button>
						</div>
				</div>
				&nbsp;
				<table class="table table-bordered table-striped text-center">
					<thead>
						<tr style="background: #3DB8B8;">
							<th class="text-center">姓名</th>
							<th class="text-center">电话</th>
							<th class="text-center">账号</th>
<!-- 							<th class="text-center">状态</th>
 -->							<th class="text-center">创建时间</th>
							<th class="text-center">操作</th>
						</tr>
					</thead>
					<tbody>
						<c:forEach items="${list}" var="user">
							<tr>
								<td>${user.userName}</td>
								<td>${user.phone}</td>
								<td>${user.account}</td>
<%-- 								<td>${user.state}</td>
 --%>								<td>${user.createDate}</td>
								<td>
									<button type = "button" class="btn btn-info btn-sm" onclick="edit(${user.userId})">编辑</button>
									<button type = "button" class="btn btn-info btn-sm" onclick="deleteUser(${user.userId})">删除</button>
								</td>
							</tr>
						</c:forEach>
					</tbody>
				</table>
				<div id="page_div">
					<jsp:include page="/margin/paginator.jsp"></jsp:include>
				</div>
			</div>
		</div>
		<input type = "hidden" id = "page" value = "${paginator.page}">
		<input type = "hidden" id = limit value = "${paginator.limit}">
	</div>
</div>
<script type="text/javascript">
var page = $("#page").val();
var limit = $("#limit").val();
$(function(){
	$(".userMenta").addClass("active open");
	$(".userSta").addClass("active");
});

function add(){
	window.location = "${pageContext.request.contextPath}/user/add";
};

function edit(userId){
	window.location = "${pageContext.request.contextPath}/user/add?userId="+userId;
};

function deleteUser(userId) {
	if (confirm("是否删除")) {
		window.location = "${pageContext.request.contextPath}/user/updateStatus?userId="
				+ userId + "&status=2" + "&pageNow=" + page + "&pageRow=" + limit;
	}
}

function qiyong(userId) {
	if (confirm("是禁用")) {
		window.location = "${pageContext.request.contextPath}/user/updateStatus?userId="
				+ userId + "&status=1" + "&pageNow=" + page + "&pageRow=" + limit;
	}
}

function jinyong(userId) {
	if (confirm("是否启用")) {
		window.location = "${pageContext.request.contextPath}/user/updateStatus?userId="
				+ userId + "&status=0" + "&pageNow=" + page + "&pageRow=" + limit;
	}
}

function queryAllPerson(pageNow, pageRow) {
	window.location = "${pageContext.request.contextPath}/user/list?pageNow="
			+ pageNow + "&pageRow=" + pageRow;
}
</script>
</body>
</html>
